package com.quan.mall.mapper;

import com.quan.mall.entity.WmsWareSku;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.quan.commons.core.biz.support.MyBaseMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 仓库-商品库存
 * 
 * @author yhaoquan
 * @email yhaoquan@163.com
 * @date 2021-04-07 22:27:21
 */
public interface WmsWareSkuMapper extends MyBaseMapper<WmsWareSku> {

	/**
     * 分页查询列表
     * @param page
     * @param entity
     * @return
     */
    IPage<WmsWareSku> selectMyPage(IPage<WmsWareSku> page, @Param("entity") WmsWareSku entity);

    /**
     * 代理商发货之后更改库存数量
     * @param skuId
     * @param num
     * @return
     */
//    @Update("update wms_ware_sku set stock = stock-#{num} where sku_id = #{skuId} and stock >= #{num}")
//    int decrCount(@Param("skuId") Long skuId, @Param("num") Integer num);
}
